package com.summer.RectTransform;

import java.awt.image.BufferedImage;  
import java.io.File;  
import java.io.IOException;  
  

import javax.imageio.ImageIO;  
  

import junit.framework.Assert;  
  

import org.junit.Test;  
  
  
@SuppressWarnings("deprecation")
public class RotateImageTest {  
  
    @Test  
    public void testRotate() throws IOException {  
  
        BufferedImage src = ImageIO.read(new File("d:/dog.jpg"));  
        BufferedImage des = RotateImage.Rotate(src, 30);  
        Assert.assertNotNull(des);  
        Assert.assertTrue(ImageIO.write(des, "jpg", new File("d:/dog2.jpg")));  
  
        // bigger angel  
        des = RotateImage.Rotate(src, 150);  
        Assert.assertNotNull(des);  
        Assert.assertTrue(ImageIO.write(des, "jpg", new File("d:/dog3.jpg")));  
  
        // bigger angel  
        des = RotateImage.Rotate(src, 270);  
        Assert.assertNotNull(des);  
        Assert.assertTrue(ImageIO.write(des, "jpg", new File("d:/dog4.jpg")));  
  
    }  
  
}